home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmWords
- Caption = "Word Analysis"
- ClientHeight = 1455
- ClientLeft = 1170
- ClientTop = 1620
- ClientWidth = 3870
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 1455
- ScaleWidth = 3870
- Begin VB.PictureBox picReport
- Height = 495
- Left = 120
- ScaleHeight = 435
- ScaleWidth = 3555
- TabIndex = 1
- Top = 840
- Width = 3615
- End
- Begin VB.CommandButton cmdAnalyze
- Caption = "Analyze Words"
- Height = 495
- Left = 720
- TabIndex = 0
- Top = 120
- Width = 2415
- End
- Attribute VB_Name = "frmWords"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdAnalyze_Click()
- Dim orderFlag As Boolean, wordCounter As Integer
- Dim word1 As String, word2 As String
- 'Count words. Are they in alphabetical order?
- orderFlag = True 'Assume words are in alphabetical order
- wordCounter = 0
- word1 = ""
- Open App.Path & "\WORDS.TXT" For Input As #1
- Do While Not EOF(1)
- Input #1, word2
- wordCounter = wordCounter + 1
- If word1 > word2 Then 'Two words are out of order
- orderFlag = False
- End If
- word1 = word2
- Loop
- Close #1
- picReport.Print "The number of words is"; wordCounter
- If orderFlag = True Then
- picReport.Print "The words are in alphabetical order."
- Else
- picReport.Print "The words are not in alphabetical order."
- End If
- End Sub
-